<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Move the cursor of a lob object</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.cubrid-lob2-seek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cubrid_lob2_seek</h1>
  <p class="verinfo">(PECL CUBRID &gt;= 8.4.1)</p><p class="refpurpose"><span class="refname">cubrid_lob2_seek</span> &mdash; <span class="dc-title">Move the cursor of a lob object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cubrid-lob2-seek-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>cubrid_lob2_seek</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$lob_identifier</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$origin</code><span class="initializer"> = CUBRID_CURSOR_CURRENT</span></span>
  ] ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>cubrid_lob2_seek()</strong></span> function is used to move the cursor
   position of a lob object by the value set in the <code class="parameter">offset</code>
   argument, to the direction set in the <code class="parameter">origin</code> argument.
  </p>
  <p class="para">
   To set the <code class="parameter">origin</code> argument, you can use CUBRID_CURSOR_FIRST
   to set the cursor position moving forward <code class="parameter">offset</code> units from
   the first beginning. In this case, <code class="parameter">offset</code> must be a positive value.
  </p>
  <p class="para">
   If you use CUBRID_CURSOR_CURRENT for <code class="parameter">origin</code>, you can move 
   forward or backward. and <code class="parameter">offset</code> can be positive or negative.
  </p>
  <p class="para">
   If you use CUBRID_CURSOR_LAST for <code class="parameter">origin</code>, you can move 
   backward <code class="parameter">offset</code> units from the end of LOB object and
   <code class="parameter">offset</code> only can be positive.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cubrid-lob2-seek-parameters">
 <h3 class="title">参数</h3>
 <p class="para">
  <dl>

   
    <dt>
<code class="parameter">lob_identifier</code></dt>

    <dd>

     <p class="para">Lob identifier as a result of <span class="function"><a href="cubrid_lob2_new.html" class="function">cubrid_lob2_new()</a></span> or get from the result set.</p>
    </dd>

   
   
    <dt>
<code class="parameter">offset</code></dt>

    <dd>

     <p class="para">Number of units you want to move the cursor.</p>
    </dd>

   
   
    <dt>
<code class="parameter">origin</code></dt>

    <dd>

     <p class="para">This parameter can be the following values:</p>
     <p class="para">CUBRID_CURSOR_FIRST: move forward from the first beginning.</p>
     <p class="para">CUBRID_CURSOR_CURRENT: move forward or backward from the current position.</p>
     <p class="para">CUBRID_CURSOR_LAST: move backward at the end of LOB object.</p>
    </dd>

   
  </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cubrid-lob2-seek-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    <strong><code>TRUE</code></strong> if the process is successful and <strong><code>FALSE</code></strong> for failure.
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.cubrid-lob2-seek-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-1130">
   <p><strong>Example #1 <span class="function"><strong>cubrid_lob2_seek()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;test_lob&nbsp;(id&nbsp;INT,&nbsp;contents&nbsp;CLOB)<br /></span><span style="color: #0000BB">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">33000</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"demodb"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"dba"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,</span><span style="color: #DD0000">"DROP&nbsp;TABLE&nbsp;if&nbsp;exists&nbsp;test_lob"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,</span><span style="color: #DD0000">"CREATE&nbsp;TABLE&nbsp;test_lob&nbsp;(id&nbsp;INT,&nbsp;contents&nbsp;CLOB)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$req&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;test_lob&nbsp;VALUES(2,&nbsp;?)"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$lob&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_lob2_new</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'CLOB'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$len&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_lob2_write</span><span style="color: #007700">(</span><span style="color: #0000BB">$lob</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Hello&nbsp;world"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_lob2_seek</span><span style="color: #007700">(</span><span style="color: #0000BB">$lob</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CUBRID_CURSOR_LAST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_lob2_write</span><span style="color: #007700">(</span><span style="color: #0000BB">$lob</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"beautiful"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_lob2_seek</span><span style="color: #007700">(</span><span style="color: #0000BB">$lob</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">15</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CUBRID_CURSOR_FIRST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_lob2_read</span><span style="color: #007700">(</span><span style="color: #0000BB">$lob</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">cubrid_lob2_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$lob</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_disconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.cubrid-lob2-seek-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
   <li class="member"><span class="function"><a href="cubrid_lob2_read.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_read()</a> - Read from BLOB/CLOB data</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_write.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_write()</a> - Write to a lob object</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_seek64.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_seek64()</a> - Move the cursor of a lob object</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_tell.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_tell()</a> - Tell the cursor position of the LOB object</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_tell64.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_tell64()</a> - Tell the cursor position of the LOB object</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_size.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_size()</a> - Get a lob object's size</span></li>
   <li class="member"><span class="function"><a href="cubrid_lob2_size64.html" class="function" rel="rdfs-seeAlso">cubrid_lob2_size64()</a> - Get a lob object's size</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>